﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_DMDonViTinh : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CKActive")]
        private CheckBox _CKActive;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("ToolStripSeparator5")]
        private ToolStripSeparator _ToolStripSeparator5;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtSearchTenAnh")]
        private TextBox _TxtSearchTenAnh;
        [AccessedThroughProperty("TxtSearchtenViet")]
        private TextBox _TxtSearchtenViet;
        [AccessedThroughProperty("TxtTenAnh")]
        private TextBox _TxtTenAnh;
        [AccessedThroughProperty("TxtTenViet")]
        private TextBox _TxtTenViet;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        private DataView cFrmData;
        private string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private int mDelData;
        private int mEditData;
        private bool mEnableControl;
        private string mKhoa;
        private int mSend;
        private clsDMDonViTinh objDMDVT;
        private DataView pDVTData;
        public string Task;

        public Frm_DMDonViTinh()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_DMDonViTinh_KeyDown);
            base.Load += new EventHandler(this.Frm_DMDonViTinh_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoaOld = "";
            this.cFrmKhoa = "";
            this.cFrmTask = "";
            this.objDMDVT = new clsDMDonViTinh();
            this.Task = "";
            this.mEditData = 1;
            this.mDelData = 1;
            this.InitializeComponent();
        }

        public bool CheckIvalid()
        {
            if (this.objDMDVT.isDupplicateCode(this.cFrmKhoa, this.TxtTenViet.Text.Trim()))
            {
                MessageBox.Show(modGeneral.Tranlated("T\x00ean này đã t\x00f4̀n tại. Bạn vui l\x00f2ng nh\x00e2̣p t\x00ean khác!", ""));
                this.TxtTenViet.Focus();
                return false;
            }
            if ((this.TxtTenViet.Text.Trim() == "") & (this.TxtTenAnh.Text.Trim() == ""))
            {
                MessageBox.Show(modGeneral.Tranlated("Bạn phải nh\x00e2̣p t\x00ean!", ""));
                this.TxtTenViet.Focus();
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            this.cFrmKhoa = modGeneral.CreatKey("DM_DonViTinh", 10, "");
            this.cFrmTask = "I";
            this.TxtTenViet.Text = "";
            this.TxtTenAnh.Text = "";
            this.TxtDienGiai.Text = "";
            this.CKActive.CheckState = CheckState.Checked;
            this.EnableControl = true;
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.VSList.Rows.Count != 1) && (this.VSList.Row > 0)) && LVYModule.ConfirmDelete(""))
            {
                DataTable table = new DataTable();
                if (this.objDMDVT.CheckDelete(this.objDMDVT.Khoa).Rows.Count > 0)
                {
                    LVYModule.ShowWarning("Đơn vị t\x00ednh n\x00e0y đ\x00e3 được sử dụng. Bạn kh\x00f4ng thể x\x00f3a!");
                }
                else if (this.objDMDVT.Delete(this.objDMDVT.Khoa))
                {
                    this.VSList.RemoveItem(this.VSList.Row);
                    this.VSList_RowColChange(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            this.EnableControl = true;
            this.cFrmTask = "U";
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdHelp_Click(object sender, EventArgs e)
        {
            LVYModule.ShowHelp(@"DANHMUCDUNGCHUNG\DANHMUC\DONVITINH.mht");
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.objDMDVT.ShowListByField("Khoa|TenViet|TenAnh|DienGiai", "", "TenViet");
            Rpt_DMDonViTinh tinh = new Rpt_DMDonViTinh();
            try
            {
                tinh.SetDataSource(dataTable);
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    tinh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                }
                else
                {
                    tinh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                }
                tinh.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                tinh.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                tinh.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                tinh.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                tinh.SetParameterValue(5, modGeneral.Tranlated("DANH MỤC ĐƠN VỊ T\x00cdNH", ""));
                tinh.SetParameterValue(6, modGeneral.Tranlated("STT", ""));
                tinh.SetParameterValue(7, modGeneral.Tranlated("T\x00ean (Tiếng Việt)", ""));
                tinh.SetParameterValue(8, modGeneral.Tranlated("T\x00ean (Tiếng Anh)", ""));
                tinh.SetParameterValue(9, modGeneral.Tranlated("Diễn giải", ""));
                tinh.SetParameterValue(10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                tinh.SetParameterValue(11, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = tinh;
                MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                this.Cursor = Cursors.Default;
                MyProject.Forms.Frm_ViewReport.ShowDialog();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                ProjectData.ClearProjectError();
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid() && this.UpdateData())
            {
                this.EnableControl = false;
                this.LoadData();
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            this.EnableControl = false;
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_DMDonViTinh_KeyDown(object sender, KeyEventArgs e)
        {
        }

        private void Frm_DMDonViTinh_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnableControl = false;
                this.SetLanguage();
                this.LoadData();
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_DMDonViTinh));
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator5 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.CKActive = new CheckBox();
            this.TxtDienGiai = new TextBox();
            this.Label4 = new Label();
            this.TxtTenViet = new TextBox();
            this.TxtTenAnh = new TextBox();
            this.Label3 = new Label();
            this.Label2 = new Label();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1 = new Panel();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.TxtSearchTenAnh = new TextBox();
            this.TxtSearchtenViet = new TextBox();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.ToolStrip1.SuspendLayout();
            this.VSList.BeginInit();
            this.Panel1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.SuspendLayout();
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator5, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator3, this.CmdDel, this.ToolStripSeparator1, this.CmdPrint, this.ToolStripSeparator2, this.CmdExit, this.CmdHelp });
            Point point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            Size size = new Size(0x2b6, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 8;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator5.Name = "ToolStripSeparator5";
            size = new Size(6, 0x19);
            this.ToolStripSeparator5.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageScaling = ToolStripItemImageScaling.None;
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&Xo\x00e1";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.White;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x48, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "Trợ gi\x00fap";
            this.CKActive.AutoSize = true;
            this.CKActive.BackColor = Color.Transparent;
            point = new Point(0x5e, 0x74);
            this.CKActive.Location = point;
            this.CKActive.Name = "CKActive";
            size = new Size(0x38, 0x11);
            this.CKActive.Size = size;
            this.CKActive.TabIndex = 3;
            this.CKActive.Text = "Active";
            this.CKActive.UseVisualStyleBackColor = false;
            point = new Point(0x5e, 0x57);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x11d, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 2;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(8, 90);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x30, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x41;
            this.Label4.Text = "Diễn giải";
            point = new Point(0x5e, 20);
            this.TxtTenViet.Location = point;
            this.TxtTenViet.Name = "TxtTenViet";
            size = new Size(0x11d, 20);
            this.TxtTenViet.Size = size;
            this.TxtTenViet.TabIndex = 0;
            point = new Point(0x5e, 0x35);
            this.TxtTenAnh.Location = point;
            this.TxtTenAnh.Name = "TxtTenAnh";
            size = new Size(0x11d, 20);
            this.TxtTenAnh.Size = size;
            this.TxtTenAnh.TabIndex = 1;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(6, 0x38);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(80, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x40;
            this.Label3.Text = "T\x00ean (tiếng Anh)";
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(6, 0x17);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x4f, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x3f;
            this.Label2.Text = "T\x00ean (tiếng Việt)";
            this.VSList.AllowEditing = false;
            this.VSList.AllowResizing = AllowResizingEnum.None;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSList.ColumnInfo = "4,0,0,0,0,85,Columns:0{Caption:\"Khoa\";Visible:False;}\t1{Width:140;Caption:\"T\x00ean (Việt)\";}\t2{Width:103;Caption:\"T\x00ean (Anh)\";}\t3{Width:192;Caption:\"T\x00ean loại v\x00e9\";Visible:False;}\t";
            this.VSList.Dock = DockStyle.Fill;
            this.VSList.ExtendLastCol = true;
            this.VSList.FocusRect = FocusRectEnum.None;
            this.VSList.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0xa3);
            point = new Point(0, 0);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            this.VSList.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x12f, 380);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 13;
            this.VSList.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel1.Controls.Add(this.Label8);
            this.Panel1.Controls.Add(this.Label7);
            this.Panel1.Controls.Add(this.TxtSearchTenAnh);
            this.Panel1.Controls.Add(this.TxtSearchtenViet);
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 380);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x12f, 0x25);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 12;
            this.Label8.AutoSize = true;
            this.Label8.BackColor = Color.Transparent;
            point = new Point(0x9e, 0x18);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(70, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x13;
            this.Label8.Text = "T\x00ecm (t\x00ean Anh)";
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(9, 0x18);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x45, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x12;
            this.Label7.Text = "T\x00ecm (t\x00ean Việt)";
            point = new Point(0x97, 3);
            this.TxtSearchTenAnh.Location = point;
            this.TxtSearchTenAnh.Name = "TxtSearchTenAnh";
            size = new Size(140, 20);
            this.TxtSearchTenAnh.Size = size;
            this.TxtSearchTenAnh.TabIndex = 1;
            point = new Point(11, 3);
            this.TxtSearchtenViet.Location = point;
            this.TxtSearchtenViet.Name = "TxtSearchtenViet";
            size = new Size(0x8a, 20);
            this.TxtSearchtenViet.Size = size;
            this.TxtSearchtenViet.TabIndex = 0;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Left;
            point = new Point(0, 0x19);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0x131, 0x1bb);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 0x42;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.VSList);
            this.C1DockingTabPage1.Controls.Add(this.Panel1);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x12f, 0x1a1);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Danh s\x00e1ch đơn vị t\x00ednh";
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Dock = DockStyle.Fill;
            point = new Point(0x131, 0x19);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x185, 0x1bb);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 0x42;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.TxtTenViet);
            this.C1DockingTabPage2.Controls.Add(this.CKActive);
            this.C1DockingTabPage2.Controls.Add(this.Label2);
            this.C1DockingTabPage2.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage2.Controls.Add(this.Label3);
            this.C1DockingTabPage2.Controls.Add(this.Label4);
            this.C1DockingTabPage2.Controls.Add(this.TxtTenAnh);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x183, 0x1a1);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Th\x00f4ng tin chi tiết";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x2b6, 0x1d4);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_DMDonViTinh";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "DM-0020             ";
            this.Text = "DANH MUC DON VI TINH";
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.VSList.EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.C1DockingTabPage2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void LoadData()
        {
            this.pDVTData = new DataView(this.objDMDVT.GetListField("Khoa|TenViet|TenAnh", "", ""));
            this.VSList.DataSource = this.pDVTData;
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            vSList.Cols[0].Visible = false;
            vSList.Cols[1].Width = 140;
            vSList[0, 1] = modGeneral.Tranlated("T\x00ean (Tiếng Việt)", "");
            vSList[0, 2] = modGeneral.Tranlated("T\x00ean (Tiếng Anh)", "");
            vSList = null;
        }

        public void SearchDonViTinh(string field, string str)
        {
            string str2 = field + " LIKE '%" + str + "%'";
            this.pDVTData.RowFilter = str2;
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.Select(1, 0, 1, this.VSList.Cols.Count - 1);
            }
        }

        public void SetLanguage()
        {
            this.CmdAdd.Text = modGeneral.Tranlated(this.CmdAdd.Text, "");
            this.CmdEdit.Text = modGeneral.Tranlated(this.CmdEdit.Text, "");
            this.CmdDel.Text = modGeneral.Tranlated(this.CmdDel.Text, "");
            this.CmdSave.Text = modGeneral.Tranlated(this.CmdSave.Text, "");
            this.CmdUnsave.Text = modGeneral.Tranlated(this.CmdUnsave.Text, "");
            this.CmdPrint.Text = modGeneral.Tranlated(this.CmdPrint.Text, "");
            this.CmdHelp.Text = modGeneral.Tranlated(this.CmdHelp.Text, "");
            this.CmdExit.Text = modGeneral.Tranlated(this.CmdExit.Text, "");
            this.Label2.Text = modGeneral.Tranlated(this.Label2.Text, "");
            this.Label3.Text = modGeneral.Tranlated(this.Label3.Text, "");
            this.Label4.Text = modGeneral.Tranlated(this.Label4.Text, "");
            this.Label7.Text = modGeneral.Tranlated(this.Label7.Text, "");
            this.Label8.Text = modGeneral.Tranlated(this.Label8.Text, "");
            this.CKActive.Text = modGeneral.Tranlated(this.CKActive.Text, "");
            this.C1DockingTab1.Text = modGeneral.Tranlated(this.C1DockingTab1.Text, "");
            this.C1DockingTab2.Text = modGeneral.Tranlated(this.C1DockingTab2.Text, "");
        }

        public void ShowData(string pKhoa)
        {
            clsDMDonViTinh objDMDVT = this.objDMDVT;
            objDMDVT.Load(pKhoa);
            this.cFrmKhoa = objDMDVT.Khoa;
            this.TxtTenViet.Text = objDMDVT.TenViet.Trim();
            this.TxtTenAnh.Text = objDMDVT.TenAnh.Trim();
            this.TxtDienGiai.Text = objDMDVT.DienGiai.Trim();
            if (objDMDVT.Active == 1)
            {
                this.CKActive.CheckState = CheckState.Checked;
            }
            else
            {
                this.CKActive.CheckState = CheckState.Unchecked;
            }
            this.mSend = objDMDVT.Send;
            objDMDVT = null;
        }

        private void TxtSearchTenAnh_TextChanged(object sender, EventArgs e)
        {
            this.SearchDonViTinh("TenAnh", this.TxtSearchTenAnh.Text);
        }

        private void TxtSearchtenViet_TextChanged(object sender, EventArgs e)
        {
            this.SearchDonViTinh("TenViet", this.TxtSearchtenViet.Text);
        }

        private void TxtTenViet_LostFocus(object sender, EventArgs e)
        {
            if (this.TxtTenAnh.Text.Trim() == "")
            {
                this.TxtTenAnh.Text = this.TxtTenViet.Text;
            }
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsDMDonViTinh objDMDVT = this.objDMDVT;
            objDMDVT.Khoa = this.cFrmKhoa;
            objDMDVT.TenViet = this.TxtTenViet.Text.Trim();
            objDMDVT.TenAnh = this.TxtTenAnh.Text.Trim();
            objDMDVT.DienGiai = this.TxtDienGiai.Text.Trim();
            if (this.CKActive.CheckState == CheckState.Checked)
            {
                objDMDVT.Active = 1;
            }
            else
            {
                objDMDVT.Active = 0;
            }
            objDMDVT.KhoaNhanVienCapNhat = modGeneral.H_USERID;
            objDMDVT.NgayCapNhat = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            return objDMDVT.Save(this.cFrmTask);
            objDMDVT = null;
            return flag;
        }

        private void VSList_RowColChange(object sender, EventArgs e)
        {
            if ((this.VSList.Rows.Count != 1) && (this.VSList.Row > 0))
            {
                this.ShowData(Conversions.ToString(this.VSList[this.VSList.Row, 0]));
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual CheckBox CKActive
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKActive;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKActive = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdHelp_Click);
                if (this._CmdHelp != null)
                {
                    this._CmdHelp.Click -= handler;
                }
                this._CmdHelp = value;
                if (this._CmdHelp != null)
                {
                    this._CmdHelp.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnableControl
        {
            get
            {
                return this.mEnableControl;
            }
            set
            {
                this.mEnableControl = value;
                this.TxtTenViet.ReadOnly = !value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.TxtTenAnh.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.VSList.Enabled = !value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.CmdExit.Enabled = !value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator5 = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual TextBox TxtSearchTenAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchTenAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSearchTenAnh_TextChanged);
                if (this._TxtSearchTenAnh != null)
                {
                    this._TxtSearchTenAnh.TextChanged -= handler;
                }
                this._TxtSearchTenAnh = value;
                if (this._TxtSearchTenAnh != null)
                {
                    this._TxtSearchTenAnh.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtSearchtenViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchtenViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSearchtenViet_TextChanged);
                if (this._TxtSearchtenViet != null)
                {
                    this._TxtSearchtenViet.TextChanged -= handler;
                }
                this._TxtSearchtenViet = value;
                if (this._TxtSearchtenViet != null)
                {
                    this._TxtSearchtenViet.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtTenAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenAnh = value;
            }
        }

        internal virtual TextBox TxtTenViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTenViet_LostFocus);
                if (this._TxtTenViet != null)
                {
                    this._TxtTenViet.LostFocus -= handler;
                }
                this._TxtTenViet = value;
                if (this._TxtTenViet != null)
                {
                    this._TxtTenViet.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSList_RowColChange);
                if (this._VSList != null)
                {
                    this._VSList.RowColChange -= handler;
                }
                this._VSList = value;
                if (this._VSList != null)
                {
                    this._VSList.RowColChange += handler;
                }
            }
        }
    }
}

